<html>
  <head>
    <title>display</title>
    <style>
      #p1 {
        background-color: #99ffcc;
      }
      #p2 {
        background-color: #99000050;
      }
      #p3 {
        background-color: #0000cc50;
      }
      .pp {
        display: inline;
      }
    </style>
  </head>
  <body>
    <p id="p1" class="pp">
      111111
    </p>
    <p id="p2" class="pp">
      222222
    </p>
    <p id="p3" class="pp">
      <i>33333</i>333333
    </p>
    <button onclick="toggle();">Click</button>
    <script>
        function toggle(){
            var e=document.getElementsByClassName("pp");
            for(let i=0;i<3;i++){
                e[i].style.display=(e[i].style.display=="inline")?"block":"inline";
            }
        }
    </script>
  </body>
</html>
